package com.example.dialog


import android.os.Bundle
import android.widget.ImageView
import android.widget.TextView
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import androidx.core.widget.doAfterTextChanged
import com.example.dialog.Dialog2
import com.example.dialog.R

class MainActivity : AppCompatActivity(){
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        val tvButton = findViewById<TextView>(R.id.tvButton)
        tvButton.setOnClickListener{
            val dialog = Dialog2()//把弹窗定义出来
            dialog.show(supportFragmentManager,"")
        }
    }
}